<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Car Service</title>
</head>
<script type="text/javascript" src="js/fieldValidator.js">
	
</script>
<script type="text/javascript">
	function validateForm() {
		var u = validateEmpty(document.getElementById('uname'), 'userError');
		var p = validateLength(document.getElementById('upass'), 'passError', 5);
		return u && p;
	}
</script>
<body>
	<h3>Kasabisu</h3>
	<div align="center">
		<table>
			<tr>
				<td>Ingregistrare obligatorie</td>
			</tr>
			<tr>
				<td>
					<div style="margin-bottom: 300px; padding-top: 20px;">
						<form method="post" action="LoginServlet" name="login">
							<table>
								<tr>
									<td colspan="2" align="center"><span id="userError">&nbsp;</span>
									</td>
								</tr>
								<tr>
									<td align="right">nume:</td>
									<td><input type="text" title="Nume" id="uname" autocomplete="off"
										name="uname" onblur="validateEmpty(this,'userError');" /></td>
								</tr>
								<tr>
									<td colspan="2" align="center"><span id="passError">&nbsp;</span>
									</td>
								</tr>
								<tr>
									<td align="right">parola:</td>
									<td><input type="password" title="Parola" id="upass"
										name="upass" onblur="validateLength(this,'passError',5);" /></td>
								</tr>
								<tr>
									<td></td>
									<td colspan="1" align="center"><button type="submit"
											value="login" onclick="return validateForm();">Inregistrare</button></td>
								</tr>
								<tr>
									<td colspan="2" align="center">
										<%if (session.getAttribute("loginError") != null) {%>
										<h2 style="color: #E07F00;">Date incorecte</h2>
										<% } else { %>
												&nbsp;
										<% } %>
									</td>
								</tr>
							</table>
						</form>
					</div>
				</td>
			</tr>
			<tr>
				<td><jsp:include page="fragments/footer.jsp" /></td>
			</tr>
		</table>
	</div>
</body>
</html>